﻿using CMS.Tool.WebApi.Models.Base;
using CodeTool.WebApi.Models.Uploader;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;

namespace CodeTool.WebApi.Controllers
{
    /// <summary>
    /// 图片处理
    /// </summary>
    [RoutePrefix("api/Image")]
    public class ImageController : ApiController
    {
        /// <summary>
        /// 缩略图水印
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Route("resize")]
        public PostResult<string> Resize(int width, int height)
        {
            var files = HttpContext.Current.Request.Files;
            var uploader = new ImageUploder();
            uploader.ImageResize(width, height, files);
            return new PostResult<string> { data = "" };
        }

        //头像裁剪

    }
}
